﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Universitet_Fakyltet
{
    class Group
    {
        public string nameOfGroup;
        public int numberOfCourse;
        static int countMembersOfList;
        public List<Student> students = new List<Student>();

        public void FillMeaningsAboutGroups()
        {

            Random rnd = new Random();
            nameOfGroup = "Intetics" + Group.countMembersOfList;
            countMembersOfList++;
            for (int i = 0; i < 5; i++)
            {
                Student studentSample = new Student();
                studentSample.FillValuesOfStudents();
                students.Add(studentSample);
            }
            //string choice = "yes";
            //List<Student> students = new List<Student>();

            do
            {
                Student studentSample = new Student();
                studentSample.FillValuesOfStudents();
                Console.WriteLine("Введите название группы студента: ");
                nameOfGroup = Console.ReadLine();
                Console.WriteLine("Введите курс студента: ");
                numberOfCourse = Int32.Parse(Console.ReadLine());
                Console.WriteLine("Хотите добавить еще одного студента: ");
                choice = Console.ReadLine();
                students.Add(studentSample);
                countMembersOfList++;
            }
            while (choice == "yes");
        }

        public void ShowInfoAboutGroups(List<Student> students, int countMembersOfList)
        {
            Console.WriteLine("Номер группы {0}, курс {1} студента", nameOfGroup, numberOfCourse);
            for (int i = 0; i < countMembersOfList; i++)
            {
                students[i].ShowInfoAboutStudents();
            }
        }
    }
}
